<?php
include 'menu.php';

$action = (isset($_GET['action']) ? $_GET['action'] : null);
$menu= new menu();
switch($action){
	case 'delete' :
		$menu->IDmenu = $_GET['IDmenu'];
		$menu->delete();
	break;
	case 'insert' :
		//$_POST : ambil data dari form

		$menu->IDMenu = $_POST['IDMenu'];
		$menu->NamaMenu = $_POST['NamaMenu'];
		$menu->DeskripsiMenu = $_POST['DeskripsiMenu'];
		$menu->KisaranHarga = $_POST['KisaranHarga'];
		$menu->insert();
		echo "berhasil";
	break;
}
if($action != null)
	header('Location: http://localhost/WEPO-PKL/halamandashboard.php');
?>